package com.xunker.appointment.controller;

import com.xunker.appointment.result.Result;
import com.xunker.appointment.service.DepartmentService;
import com.xunker.appointment.vo.hospital.DepartmentVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "医院部门接口")
@RestController
@RequestMapping("admin/hospital/department")
//@CrossOrigin
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;
    @GetMapping("findDepartList/{hospitalCode}")
    public Result findDepartList(@PathVariable String hospitalCode){
        List<DepartmentVo> tree=departmentService.getDepartTree(hospitalCode);
        return Result.ok(tree);
    }
}
